package com.yuxi.modelExt;

import com.yuxi.common.NumberUtil;
import com.yuxi.enums.ProductTypeTypeFlagEnum;
import com.yuxi.modelDesc.ProductDesc;
import lombok.Data;


/**
 * @author sunke
 * @Date 2023-10-13 10:05:04
 * @description ProductExt      产品
 */
@Data
public class ProductExt extends ProductDesc {


    private String typeName;
    private String upTypeName;
    private String upTypeId;

    private String detailUrl;

    private Integer typeFlag;


    public String getDetailUrl() {

        String url = "/product_";
        if (NumberUtil.parseInt(getTypeFlag()) == ProductTypeTypeFlagEnum.BRAND.getType().intValue()) {
            url = "/agency_";

        }
        return url+"detail_"+getId()+".html";
    }
}

